SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE dbo.[DnnProduct_CDS_TemplateUpdatePermissions]
	@TemplateID int,
	@permissions nvarchar(max)
AS
BEGIN
	DELETE FROM [DnnProduct_CDS_DRMPermissions] WHERE [TemplateID] = @TemplateID
	IF (@permissions IS NOT NULL OR @permissions <> '')
		INSERT INTO [DnnProduct_CDS_DRMPermissions] (TemplateID, permissions) VALUES (@TemplateID, @permissions)
END
GO
